package com.guigu.common.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.common.service.DesignModuleService;
import com.guigu.common.mapper.DesignModuleMapper;
import com.guigu.common.pojo.DModuleDetails;
import com.guigu.common.pojo.DesignModule;
import com.guigu.common.vo.SearchVo;
import com.guigu.common.vo.module_detailsVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 产品物料组成业务实现类
 */
@Service
public class DesignModuleServiceImpl implements DesignModuleService {

    @Resource
    private DesignModuleMapper designModuleMapper;


    @Override
    public int deleteByPrimaryKey(Integer id) {
        return 0;
    }

    @Override
    public int insert(DesignModule record) {
        return 0;
    }

    @Override
    public int insertSelective(DesignModule record) {
        return 0;
    }

    @Override
    public DesignModule selectByPrimaryKey(Integer id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(DesignModule record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(DesignModule record) {
        return 0;
    }
    @Override
    public SearchVo<DesignModule> designModule(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DesignModule> tbCategory= designModuleMapper.querydesignModule(searchVo);
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DesignModule>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public List<DModuleDetails> queryDModule(int i) {
        return designModuleMapper.queryDModule(i);
    }

    @Override
    public void material(String id) {
        designModuleMapper.material(id);
    }
    @Override
    public void notmaterial(String id) {
        designModuleMapper.notmaterial(id);
    }

    @Override
    public SearchVo<DesignModule> qeuryall(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DesignModule> tbCategory= designModuleMapper.qeurydesignModuleall(searchVo);
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DesignModule>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public SearchVo<DesignModule> updatedesignModule(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DesignModule> tbCategory= designModuleMapper.updatedesignModule(searchVo);
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DesignModule>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public void updateinsert(DModuleDetails d) {
        designModuleMapper.updateinsert(d);
    }

    @Override
    public void updateMaterial(DModuleDetails d) {
        designModuleMapper.updateMaterial(d);
    }

    @Override
    public void updateChangerandsetCheckTag(module_detailsVo module_details) {
        designModuleMapper.updateChangerandsetCheckTag(module_details);
    }

    @Override
    public void deletedModuleDetails(int i) {
        designModuleMapper.deletedModuleDetails(i);
    }
}
